<?php

use App\Models\Article;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', 'HomeController@index')->name('/');
Route::get("/article",'Article\ArticleController@ajax');
Route::get("/articlec",'Article\ArticleController@ajaxByChannel');
Route::get('/article_list_{channel}_{page}.html', 'Article\ListController@index')->name('article.page');
Route::get('/article_list_{channel}.html', 'Article\ListController@index')->name('article.channel');
Route::get('/article_list.html','Article\ListController@index')->name('article.list');




Route::get('/article_{id}.html', function ($id){
    return view('article.detail',[
       'article' => Article::find($id)
    ]);
})->name('article.detail');
